#include <stdio.h>
#include <stdlib.h>

void solve(int n, int arr[])
{
    double sum = 0;
    for(int j = 0; j < n; j++)
    {
        sum += (double)arr[j];
    }
    sum = sum*2/n;
    if(sum == (int)sum)
    {
        int i = 0;
        int ret[n];
        for(int j = 0; j < n; j++)
        {
            ret[j] = 0;
        }
        for(i = 0; i < n; i++)
        {
            if(ret[i] != 0)
            continue;
            int flag = 1;
            for(int j = 0; j < n; j++)
            {
                if(ret[j] != 0)
                continue;
                if(arr[i] + arr[j] == sum)
                {
                    flag = 0;
                    ret[i] = j + 1;
                    ret[j] = i + 1;
                    break;
                }
            }
            if(flag)
            {
                printf("%d\n", -1);
                return;
            }
        }
        if(i == n)
        for(int k = 0; k < n; k++)
        printf("%d ", ret[k]);
        printf("\n");
    }
    else
    printf("%d\n", -1);
}

int main()
{
    int n = 0, k = 0;
    k = scanf("%d", &n);
    int* arr = (int*)malloc(sizeof(int) * n);
    for(int i = 0; i < n; i++)
    {
        k = scanf("%d", &arr[i]);
    }
    solve(n, arr);
    free(arr);
    return 0;
}